Code coverage report for ./tests/async.js

Statements: 100% (13 / 13)      Branches: 100% (0 / 0)      Functions: 100% (6 / 6)      Lines: 100% (13 / 13)     

All files » ./tests\ » async.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                1 1   1   1 1 1   1 1       1 47 47     1 1        
/**
 * Created with JetBrains PhpStorm.
 * User: Elena.Pogorelova
 * Date: 8/22/12
 * Time: 6:41 PM
 * To change this template use File | Settings | File Templates.
 */
 
describe("Asynchronous specs", function () {
    var value, flag;
 
    it("should  support async execution of test preparation and exepectations", function () {
 
        runs(function () {
            flag = false;
            value = 0;
 
            setTimeout(function () {
                flag = true;
            }, 500);
        });
 
        waitsFor(function () {
            value++;
            return flag;
        }, "The Value should be incremented", 750);
 
        runs(function () {
            expect(value).toBeGreaterThan(20);
        });
    });
});